<section class="user-profile">
    <nav class="user-profile-sidebar">
        <div class="padding-wrapper">
            <section class="user-profile-title">
                <img src="<?php echo $this->baseUrl(); ?>/images/icon_user.png" alt="User" class="user-profile-icon user-profile-title-icon" />
                <span><?php echo $this->profile->Fullname; ?></span>
            </section>
            
            <section class="user-profile-image-wrapper">
                <img src="<?php echo $this->baseUrl(); ?>/assets/users/<?php echo $this->profile->Avatar; ?>" alt="Avatar" class="user-profile-image" />
            </section>
            
            <?php
                if($this->user->Id == $this->profile->Id)
                {
            ?>
            <section class="user-profile-buttons">
                <a href="<?php echo $this->baseUrl(); ?>/user/editprofile">
                    Edit my profile
                </a>
            </section>
            <?php
                }
            ?>
        </div>
    </nav>
    
    
    <div id="tabs">
        <ul>
            <li>
                <a href="#profile">
                    Profile
                </a>
            </li>
            <li>
                <a href="#messages" class="highlight">
                    <?php echo $this->message_title; ?>
                </a>
            </li>
            <?php
                if($this->viewmessage_content)
                {
            ?>
            <li>
                <a href="#viewmessage" class="highlight">
                    View message
                </a>
            </li>
            <?php
                }
            ?>
        </ul>
        <div id="profile" class="user-profile-panel">
            <div class="column-wrapper">
                <div class="column-left">
                    <section class="user-profile-name item">
                        <label>Name</label>
                        <span><?php echo $this->profile->Fullname; ?></span>
                    </section>

                    <section class="user-profile-country item">
                        <label>Country</label>
                        <span><?php echo $this->profile->Country != null ? $this->profile->Country->Name : 'Not set'; ?></span>
                    </section>

                    <section class="user-profile-dob item">
                        <label>Birthday</label>
                        <span><?php echo $this->profile->Dob != null ? $this->profile->Dob : 'Not set'; ?></span>
                    </section>

                    <section class="user-profile-role item">
                        <label>Role</label>
                        <span><?php echo $this->profile->Role->Name; ?></span>
                    </section>

                    <section class="user-profile-date item">
                        <label>Member since</label>
                        <span><?php echo $this->profile->CreationDate; ?></span>
                    </section>
                </div>
                <div class="column-right">
                    <section class="user-profile-bio item">
                        <label>Biography</label>
                        <span><?php echo strlen($this->profile->Bio) ? nl2br($this->profile->Bio) : 'Not set'; ?></span>
                    </section>
                </div>
            </div>
        </div>
        <div id="messages" class="user-messages-panel">
            <?php echo $this->message_content; ?>
        </div>
        <?php
            if($this->viewmessage_content)
            {
        ?>
        <div id="viewmessage" class="user-messages-panel">
            <?php echo $this->viewmessage_content; ?>
        </div>
        <?php
            }
        ?>
    </div>
</section>
<input type="hidden" id="user_id" name="user_id" value="<?php echo $this->profile->Id;?>" />
<?php
    /**
     * Open tabs
     */
     if($this->message_content)
     {
?>
<script type="text/javascript">
    $(function() {
        goToHashTab('viewmessage');
    });
</script>
<?php
    }
?>